package com.ewanghuiju.app.ui.home.adapter;

import android.graphics.Paint;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.component.ImageLoader;
import com.ewanghuiju.app.model.bean.response.PintuanShopListResponBean;
import com.ewanghuiju.app.model.bean.response.ResultShopListResponBean;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author sj  qq:751943509
 * @class describe
 * @time 2020/2/20
 */
public class SearchResultShopListAdapter extends BaseQuickAdapter<ResultShopListResponBean, BaseViewHolder> {
    public SearchResultShopListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ResultShopListResponBean item) {
        helper.setText(R.id.tv_shop_title,"                 "+item.getTitle());
        helper.setText(R.id.tv_spe_price,item.getSpejia());
        TextView tv_yuan = helper.getView(R.id.tv_yuan_price);
        tv_yuan.setText("￥"+item.getYuanjia());
        tv_yuan.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); // 设置中划线并加清晰
        RoundedImageView riv=helper.getView(R.id.riv_item_icon);
        ImageLoader.load(mContext,item.getImg(),riv);
        View line = helper.getView(R.id.line);
//        line.setVisibility(item.isLast()?View.VISIBLE:View.INVISIBLE);
    }
}
